home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / SAT 2.4.0 / SAT / SAT Think Lib ƒ / Compatibility / InterfacesUI.p next >
Encoding:
Text File  |  1997-02-16  |  9.9 KB  |  335 lines  |  [TEXT/PJMM]

  1. unit InterfacesUI;
  2.  
  3. {Unit for making Think Pascal work with Universal Interfaces}
  4. {All units that are not in Interfaces.lib are not reflected here.}
  5. {This implements changes to the core Toolbox, excluding most System7-}
  6. {specific units. You have to inlude them in your project anyway, so}
  7. {you can just as well make the changes in the interface files as}
  8. {necessary.}
  9.  
  10. interface
  11.  
  12. {$SETC GENERATINGPOWERPC := FALSE}
  13.  
  14. {Controls}
  15.     const
  16.         kControlNoPart = 0;
  17.         kControlLabelPart = 1;
  18.         kControlMenuPart = 2;
  19.         kControlTrianglePart = 4;
  20.         kControlButtonPart = 10;
  21.         kControlCheckBoxPart = 11;
  22.         kControlRadioButtonPart = 11;
  23.         kControlUpButtonPart = 20;
  24.         kControlDownButtonPart = 21;
  25.         kControlPageUpPart = 22;
  26.         kControlPageDownPart = 23;
  27.         kControlIndicatorPart = 129;
  28.         kControlDisabledPart = 254;
  29.         kControlInactivePart = 255;
  30.     type
  31.         ControlRef = ControlHandle;
  32.         ConstStr255Param = Str255;
  33.         WindowRef = WindowPtr;
  34.         ControlActionUPP = ProcPtr;
  35.     procedure SetControlTitle (theControl: ControlRef; title: ConstStr255Param);
  36.     inline
  37.         $A95F;
  38.     procedure GetControlTitle (theControl: ControlRef; var title: Str255);
  39.     inline
  40.         $A95E;
  41.     procedure UpdateControls (theWindow: WindowRef; updateRgn: RgnHandle);
  42.     inline
  43.         $A953;
  44.     procedure SetControlValue (theControl: ControlRef; theValue: INTEGER);
  45.     inline
  46.         $A963;
  47.     function GetControlValue (theControl: ControlRef): INTEGER;
  48.     inline
  49.         $A960;
  50.     procedure SetControlMinimum (theControl: ControlRef; minValue: INTEGER);
  51.     inline
  52.         $A964;
  53.     function GetControlMinimum (theControl: ControlRef): INTEGER;
  54.     inline
  55.         $A961;
  56.     procedure SetControlMaximum (theControl: ControlRef; maxValue: INTEGER);
  57.     inline
  58.         $A965;
  59.     function GetControlMaximum (theControl: ControlRef): INTEGER;
  60.     inline
  61.         $A962;
  62.     function GetAuxiliaryControlRecord (theControl: ControlRef; var acHndl: AuxCtlHandle): BOOLEAN;
  63.     inline
  64.         $AA44;
  65.     procedure SetControlReference (theControl: ControlRef; data: LONGINT);
  66.     inline
  67.         $A95B;
  68.     function GetControlReference (theControl: ControlRef): LONGINT;
  69.     inline
  70.         $A95A;
  71.     procedure SetControlAction (theControl: ControlRef; actionProc: ControlActionUPP);
  72.     inline
  73.         $A96B;
  74.     function GetControlAction (theControl: ControlRef): ControlActionUPP;
  75.     inline
  76.         $A96A;
  77.     procedure SetControlColor (theControl: ControlRef; newColorTable: CCTabHandle);
  78.     inline
  79.         $AA43;
  80.     function GetControlVariant (theControl: ControlRef): INTEGER;
  81.     inline
  82.         $A809;
  83.  {Dialogs}
  84.     type
  85.         DialogRef = DialogPtr;
  86.     procedure DisposeDialog (theDialog: DialogRef);
  87.     inline
  88.         $A983;
  89.     procedure UpdateDialog (theDialog: DialogRef; updateRgn: RgnHandle);
  90.     inline
  91.         $A978;
  92.     procedure GetDialogItem (theDialog: DialogRef; itemNo: INTEGER; var itemType: INTEGER; var item: Handle; var box: Rect);
  93.     inline
  94.         $A98D;
  95.     procedure SetDialogItem (theDialog: DialogRef; itemNo: INTEGER; itemType: INTEGER; item: Handle; {CONST}
  96.                                     var box: Rect);
  97.     inline
  98.         $A98E;
  99.     procedure HideDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  100.     inline
  101.         $A827;
  102.     procedure ShowDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  103.     inline
  104.         $A828;
  105.     procedure SelectDialogItemText (theDialog: DialogRef; itemNo: INTEGER; strtSel: INTEGER; endSel: INTEGER);
  106.     inline
  107.         $A97E;
  108.     procedure GetDialogItemText (item: Handle; var text: Str255);
  109.     inline
  110.         $A990;
  111.     procedure SetDialogItemText (item: Handle; text: ConstStr255Param);
  112.     inline
  113.         $A98F;
  114.     function FindDialogItem (theDialog: DialogRef; thePt: Point): INTEGER;
  115.     inline
  116.         $A984;
  117.     function NewColorDialog (dStorage: univ Ptr; {CONST}
  118.                                     var boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: INTEGER; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: LONGINT; items: Handle): DialogRef;
  119.     inline
  120.         $AA4B;
  121.     function GetAlertStage: INTEGER;
  122.     inline
  123.         $3EB8, $0A9A;            { MOVE.W $0A9A,(SP) }
  124.  
  125.     procedure ResetAlertStage;
  126.     inline
  127.         $4278, $0A9A;
  128.     procedure DialogCut (theDialog: DialogRef);
  129.     procedure DialogPaste (theDialog: DialogRef);
  130.     procedure DialogCopy (theDialog: DialogRef);
  131.     procedure DialogDelete (theDialog: DialogRef);
  132.     procedure SetDialogFont (value: INTEGER);
  133.     inline
  134.         $31DF, $0AFA;            { MOVE.W (SP)+,$0AFA }
  135.  
  136. {Events}
  137.     function KeyTranslate (transData: univ Ptr; keycode: INTEGER; var state: LONGINT): LONGINT;
  138.     inline
  139.         $A9C3;
  140.  
  141. {Lists}
  142.     procedure LSetDrawingMode (drawIt: BOOLEAN; lHandle: ListHandle);
  143.     inline
  144.         $3F3C, $002C, $A9E7;
  145.     procedure LGetCellDataLocation (var offset: INTEGER; var len: INTEGER; theCell: Cell; lHandle: ListHandle);
  146.     inline
  147.         $3F3C, $0034, $A9E7;
  148.  
  149. {Memory}
  150.     function ApplicationZone: THz;
  151.     inline
  152.         $2EB8, $02AA;            { MOVE.L $02AA,(SP) }
  153.     function TempNewHandle (logicalSize: Size; var resultCode: OSErr): Handle;
  154.     inline
  155.         $3F3C, $001D, $A88F;
  156.     function TempMaxMem (var grow: Size): Size;
  157.     inline
  158.         $3F3C, $0015, $A88F;
  159.     function TempFreeMem: LONGINT;
  160.     inline
  161.         $3F3C, $0018, $A88F;
  162.  {  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  }
  163.     procedure TempHLock (h: Handle; var resultCode: OSErr);
  164.     inline
  165.         $3F3C, $001E, $A88F;
  166.     procedure TempHUnlock (h: Handle; var resultCode: OSErr);
  167.     inline
  168.         $3F3C, $001F, $A88F;
  169.     procedure TempDisposeHandle (h: Handle; var resultCode: OSErr);
  170.     inline
  171.         $3F3C, $0020, $A88F;
  172.     function TempTopMem: Ptr;
  173.     inline
  174.         $3F3C, $0016, $A88F;
  175.     procedure ReserveMem (cbNeeded: Size);
  176.     inline
  177.         $201F, $A040;
  178.     procedure ReserveMemSys (cbNeeded: Size);
  179.     inline
  180.         $201F, $A440;
  181.     procedure DisposePtr (p: Ptr);        {Unnecessary?}
  182.     inline
  183.         $205F, $A01F;
  184.     procedure DisposeHandle (h: Handle);    {Unnecessary?}
  185.     inline
  186.         $205F, $A023;
  187.     procedure ReallocateHandle (h: Handle; byteCount: Size);
  188.     inline
  189.         $201F, $205F, $A027;
  190.  {Menus}
  191.     type
  192.         MenuRef = MenuHandle;
  193.     procedure AppendResMenu (theMenu: MenuRef; theType: ResType);
  194.     inline
  195.         $A94D;
  196.     procedure InsertMenuItem (theMenu: MenuRef; itemString: ConstStr255Param; afterItem: INTEGER);
  197.     inline
  198.         $A826;
  199.     procedure DeleteMenuItem (theMenu: MenuRef; item: INTEGER);
  200.     inline
  201.         $A952;
  202.     procedure SetMenuItemText (theMenu: MenuRef; item: INTEGER; itemString: ConstStr255Param);
  203.     inline
  204.         $A947;
  205.     procedure GetMenuItemText (theMenu: MenuRef; item: INTEGER; var itemString: Str255);
  206.     inline
  207.         $A946;
  208.     function GetMenuHandle (menuID: INTEGER): MenuRef;
  209.     inline
  210.         $A949;
  211.     procedure DeleteMCEntries (menuID: INTEGER; menuItem: INTEGER);
  212.     inline
  213.         $AA60;
  214.     procedure DisposeMCInfo (menuCTbl: MCTableHandle);
  215.     inline
  216.         $AA63;
  217.  {OSUtils}
  218.     type
  219.         LongDateRec = DateTimeRec;
  220.         LongDateTime = Longint;
  221.     procedure LongDateToSeconds ({CONST}
  222.                                     var lDate: LongDateRec; var lSecs: LongDateTime);
  223.     inline
  224.         $2F3C, $8008, $FFF2, $A8B5;
  225.     procedure LongSecondsToDate (var lSecs: LongDateTime; var lDate: LongDateRec);
  226.     inline
  227.         $2F3C, $8008, $FFF0, $A8B5;
  228.     function IsMetric: BOOLEAN;
  229.     inline
  230.         $3F3C, $0004, $A9ED;
  231.     procedure DateToSeconds ({CONST}
  232.                                     var d: DateTimeRec; var secs: LONGINT);
  233.     procedure SecondsToDate (secs: LONGINT; var d: DateTimeRec);
  234.     inline
  235.         $205F, $201F, $A9C6;
  236. {PictUtils}
  237.     function DisposePictInfo (thePictInfoID: Longint): OSErr;
  238.     inline
  239.         $303C, $0206, $A831;
  240. {QuickDraw - unnecessary?}
  241.     procedure DisposePixMap (pm: PixMapHandle);
  242.     inline
  243.         $AA04;
  244.     procedure DisposePixPat (pp: PixPatHandle);
  245.     inline
  246.         $AA08;
  247.     procedure DisposeCTable (cTable: CTabHandle);
  248.     inline
  249.         $AA24;
  250.     procedure DisposeCCursor (cCrsr: CCrsrHandle);
  251.     inline
  252.         $AA26;
  253.     procedure DisposeCIcon (theIcon: CIconHandle);    {Rather Icons.p today?}
  254.     inline
  255.         $AA25;
  256.     procedure DisposeGDevice (gdh: GDHandle);
  257.     inline
  258.         $AA30;
  259.  {QuickdrawText}
  260. {function PixelToChar (textBuf: Ptr; textLength: LONGINT; slop: Fixed; pixelWidth: Fixed; var leadingEdge: BOOLEAN; var widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  261. {inline}
  262. {$2F3C, $8222, $002E, $A8B5;}
  263. {function CharToPixel (textBuf: Ptr; textLength: LONGINT; slop: Fixed; offset: LONGINT; direction: INTEGER; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  264. {inline}
  265. {$2F3C, $821C, $0030, $A8B5;}
  266. {procedure DrawJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  267. {inline}
  268. {$2F3C, $8016, $0032, $A8B5;}
  269. {procedure MeasureJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  270. {inline}
  271. {$2F3C, $801A, $0034, $A8B5;}
  272. {function PortionLine (textPtr: Ptr; textLen: LONGINT; styleRunPosition: JustStyleCode; numer: Point; denom: Point): Fixed;}
  273. {inline}
  274. {$2F3C, $8412, $0036, $A8B5;}
  275.  {Resources}
  276.     function GetResourceSizeOnDisk (theResource: Handle): LONGINT;
  277.     inline
  278.         $A9A5;
  279.     function GetMaxResourceSize (theResource: Handle): LONGINT;
  280.     inline
  281.         $A821;
  282.     procedure RemoveResource (theResource: Handle);
  283.     inline
  284.         $A9AD;
  285.  {TextEdit}
  286.     type
  287.         TEClickLoopUPP = ProcPtr;
  288.         WordBreakUPP = ProcPtr;
  289.     procedure TESetAlignment (just: INTEGER; hTE: TEHandle);
  290.     inline
  291.         $A9DF;
  292.     procedure TETextBox (text: univ Ptr; length: LONGINT; {CONST}
  293.                                     var box: Rect; just: INTEGER);
  294.     inline
  295.         $A9CE;
  296.     function TEStyleNew ({CONST}
  297.                                     var destRect: Rect; {CONST}
  298.                                     var viewRect: Rect): TEHandle;
  299.     inline
  300.         $A83E;
  301.     procedure TESetStyleHandle (theHandle: TEStyleHandle; hTE: TEHandle);
  302.     inline
  303.         $3F3C, $0005, $A83D;
  304.     function TEGetStyleHandle (hTE: TEHandle): TEStyleHandle;
  305.     inline
  306.         $3F3C, $0004, $A83D;
  307.     procedure TEStylePaste (hTE: TEHandle);
  308.     inline
  309.         $3F3C, $0000, $A83D;
  310.     function TEGetStyleScrapHandle (hTE: TEHandle): StScrpHandle;
  311.     inline
  312.         $3F3C, $0006, $A83D;
  313.     procedure TEUseStyleScrap (rangeStart: LONGINT; rangeEnd: LONGINT; newStyles: StScrpHandle; fRedraw: BOOLEAN; hTE: TEHandle);
  314.     inline
  315.         $3F3C, $000B, $A83D;
  316.     procedure TESetClickLoop (clikProc: TEClickLoopUPP; hTE: TEHandle);
  317.     function TEGetScrapLength: LONGINT;
  318.     procedure TESetWordBreak (wBrkProc: WordBreakUPP; hTE: TEHandle);
  319.     procedure TEStyleInsert (text: univ Ptr; length: LONGINT; hST: StScrpHandle; hTE: TEHandle);
  320.     inline
  321.         $3F3C, $0007, $A83D;
  322.  
  323. implementation
  324.  
  325. {If you need TESetClickLoop, and it isn't implemented by any library you have then you need to include}
  326. {the following code in some unit:}
  327.  
  328. {procedure TESetClickLoop (clikProc: TEClickLoopUPP; hTE: TEHandle);}
  329. {begin}
  330. {SetClikLoop(clikProc, hTE);}
  331. {end;}
  332.  
  333. {In SAT, use the file SetClikLoopGlue.p}
  334.  
  335. end.